﻿@model IEnumerable<Guline.Web.CentralModels.Object.Message>
@{
    ViewBag.Title = @Guline.Web.CentralLanguages.Main.lblMessage;
    Layout = "~/Views/Shared/_GLSettingLayout.cshtml";
}

<div class="">
    <span class="s_title_body_right" style="float:left;">@ViewBag.Title</span>
    <div class="">@Html.ActionLink(@Guline.Web.CentralLanguages.Main.lblCreate, "CreateSMS", "Message", null, new { @class = "btn_add" })</div>
</div>
<div class="clr"></div>

<div class="s_content_body_right">
    <table id="example" class="display" cellspacing="0" width="100%">
        <thead>
            <tr>
                <th>
                    <p>@Guline.Web.CentralLanguages.Main.lblContent</p>
                </th>
                <th>
                    <p>@Guline.Web.CentralLanguages.Main.lblToNumber</p>
                </th>
                <th>
                    <p>@Guline.Web.CentralLanguages.Main.lblCreateDate</p>
                </th>
                <th>
                    <p>@Guline.Web.CentralLanguages.Main.lblDateSent</p>
                </th>
                <th>
                    <p>@Guline.Web.CentralLanguages.Main.lblStatus</p>
                </th>
                <th>
                    <p>@Guline.Web.CentralLanguages.Main.lblDeviceID</p>
                </th>
                <th>
                </th>
            </tr>
        </thead>
        <tbody>

            @foreach (var m in Model)
            {
                <tr>
                    <td>
                        <div class="break_words ">
                            @m.Content
                        </div>
                    </td>
                    <td class="td_center">
                        <div class="break_word">
                            @m.Contact.ContactName - 
                            @m.ToPhoneNumber
                        </div>
                    </td>
                    <td class="td_center">
                        <div class="break_word">
                            @m.DateCreated
                        </div>
                    </td>
                    <td class="td_center">
                        <div class="break_word">
                            @m.DateSent
                        </div>
                    </td>
                    <td class="td_center">
                        <div class="break_word">
                            @if(m.Status==0)
                            {
                                <b style="color:#ff9e04">Waiting!</b>
                            }
                            else if(m.Status==1)
                            {
                                <b style="color:green">Done!</b>
                            }
                            else
                            {
                                <b style="color:red">Fail!</b>
                            }
                        </div>
                    </td>
                    <td class="td_center">
                        <div class="break_word">
                            @m.Device.Name
                        </div>
                    </td>
                    <td class="td_center">
                        @*@Html.ActionLink("Edit", "EidtSMS", "Message", new { ID = m.ID }, new { @class = "edit_text" })*@
                        <div class="clear-fix"></div>
                        <a href="@Url.Action("DeleteSMS", "Message", new { ID = m.ID })" onclick="return confirm('@Guline.Web.CentralLanguages.Main.lblConfirm @ViewBag.Title?\n @Guline.Web.CentralLanguages.Main.lblID:@m.ID\n @Guline.Web.CentralLanguages.Main.lblContent: @m.Content')" class="delete_text">@Guline.Web.CentralLanguages.Main.lblDelete</a>
                    </td>

                </tr>
            }
        <tbody>
    </table>
</div>